package com.lzq.ribbon.client;

import com.lzq.ribbon.Entity.Customer;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

@FeignClient("PRODUCER-SERVICE")
public interface searchClient {
    @RequestMapping(value = "/search",method = RequestMethod.GET)
    String search();

    @RequestMapping(value = "/search/{id}",method = RequestMethod.GET)
    Customer findByid(@PathVariable(value = "id") Integer id);

    @RequestMapping(value = "/getCustomer",method = RequestMethod.GET)
    Customer getCustomer(@RequestParam(value = "id") Integer id, @RequestParam(value = "name") String name);

    @RequestMapping(value = "/save",method = RequestMethod.GET)//会自动转为POST请求，出现405错误
    public Customer save(@RequestBody Customer customer);
}
